<?php
class UI_Error{	
	public static function imprimeError($objError,$getString=false) {
		$html = "
		<br>
		<div class='ui-widget'>
			<div class='ui-state-error ui-corner-all' style='padding: 0 .7em;'> 
				<p><span class='ui-icon ui-icon-alert' style='float: left; margin-top:7px; margin-right: .3em;'></span>
				<div style='font-weight: bolder; display: inline;'>";
		switch (get_class($objError)) {
			case 'ErrorBD_MySQL':			
				$html.='Error '.$objError->getErrorNumber().' - '.$objError->getErrorMessage().'</div>';
				if($objError->getQuery()!=''){ 
					$html.='<br>'.$objError->getQuery();
				}
			break;
			case 'Error':
				$html.='Error '.$objError->getUbicacion().'</div>';
				$html.='<br>'.$objError->getDescripcion();
			break;
			default:
				$html.='</div>';
			break;
		}
		$html.="</p>
			</div>
		</div>
		";
		if($getString){
			return $html;
		}
		else{
			echo $html;
		}
	}		
}